package com.tencent.qcloud.timchat.model;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bxd.baodan.R;
import com.bxd.baodan.item.PlanerBean;
import com.bxd.baodan.util.GlideUtil;
import com.bxd.baodan.widget.StarBarView;
import com.tencent.qcloud.timchat.adapters.ChatAdapter;

/**
 * 群tips消息
 */
public class HeadCardMessage extends Message {
    PlanerBean.PlanerBean_ bean;


    public HeadCardMessage(PlanerBean.PlanerBean_ bean_) {
        bean = bean_;


    }

    @Override
    public void showMessage(ChatAdapter.ViewHolder viewHolder, Context context) {
        viewHolder.leftPanel.setVisibility(View.GONE);
        viewHolder.rightPanel.setVisibility(View.GONE);
        View view = viewHolder.headLy;
        view.setVisibility(View.VISIBLE);

       ImageView avatar = view.findViewById(R.id.avatar);
       TextView name = view.findViewById(R.id.name);
        TextView sign = view.findViewById(R.id.sign);
        TextView count = view.findViewById(R.id.count);
        StarBarView starBar = view.findViewById(R.id.star_bar);

        GlideUtil.loadCircle(context,bean.avatar,avatar);
        name.setText(bean.nickname);
        sign.setText(bean.sign);
        count.setText(bean.serviceCount+"");
        starBar.setStarRating(bean.star);

    }

    @Override
    public String getSummary() {
        return null;
    }

    @Override
    public void save() {

    }
}
